﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;
using UnityEngine;
/// <summary>
/// MD5加密
/// </summary>
public class MD5Crypto  {
    public static string GetMD5_32(string s)
    {
        MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
        string t2 = BitConverter.ToString(md5.ComputeHash(UTF8Encoding.Default.GetBytes(s)));
        t2 = t2.Replace("-", "").ToLower();
        return t2;
    }
    public static string GetMD5_16(string s)
    {
        MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
        string t2 = BitConverter.ToString(md5.ComputeHash(UTF8Encoding.Default.GetBytes(s)), 4, 8);
        t2 = t2.Replace("-", "").ToLower();
        return t2;
    }
}
